package cn.edu.zjgsu.ito.service;

import java.util.List;

import cn.edu.zjgsu.ito.model.CourseModel;

import com.jfinal.plugin.activerecord.Db;
import com.jfinal.plugin.activerecord.Record;

public class CourseService extends Service {
	public List<Record> allCourse() {
		try {
			List<Record> list=Db.find(CourseModel.dao.selectAllCourseSql);

			return list;
		} catch (Exception e) {
			e.printStackTrace();
			return null;
		}

	}
	
	public Record Course(String courseName) {
		try {
			Record list=Db.findFirst(CourseModel.dao.selectCourseSql,courseName);

			return list;
		} catch (Exception e) {
			e.printStackTrace();
			return null;
		}

	}
	
	public List<Record> selectTeaGrade() {
		try {
			List<Record> list=Db.find(CourseModel.dao.selectAllCourseSql);

			return list;
		} catch (Exception e) {
			e.printStackTrace();
			return null;
		}

	}

}
